package com.chenwang.measure.ui.dialog;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Build;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.chenwang.measure.R;
import com.chenwang.measure.base.BaseDialogFragment;
import com.github.ybq.android.spinkit.sprite.Sprite;
import com.github.ybq.android.spinkit.style.Circle;

import java.lang.reflect.Field;


/**
 * @松 on 2019/7/15 13:37
 */
public class LoadingViewDialog extends BaseDialogFragment {

    private ProgressBar mProgressBar;
    private TextView mTextView;
    private String mContent;

    public LoadingViewDialog() {

    }
    @SuppressLint("ValidFragment")
    public LoadingViewDialog(String content) {
         mContent =content;
    }

    @Override
    public int setLayoutId() {
        return R.layout.dialog_loading_view;
    }

    @Override
    protected void initWindow(Window window) {
            setLayoutParams(window,Gravity.CENTER, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT,0 ,0 );
           // setStatus(window);

    }

    @Override
    protected void initData(View view) {
        super.initData(view);
        mProgressBar = (ProgressBar)view.findViewById(R.id.spin_kit);
        mTextView = view.findViewById(R.id.tv);
        Sprite doubleBounce = new Circle();
       // Sprite doubleBounce = new FadingCircle();
        mProgressBar.setIndeterminateDrawable(doubleBounce);
        mTextView.setText(mContent);

    }
    /*public void setContent(String content){


    }*/




}
